<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			// 登录状态有效的判断逻辑  @todo 后续添加token有效判断，或者后端统一判断
			let userInfo = {}
			if(uni.getStorageSync("userInfo")!=""){
				userInfo = JSON.parse(uni.getStorageSync("userInfo"))
				this.$store.state.userInfo=userInfo
				this.$store.state.hasLogin=true
				console.log("已登录")
				// uni.switchTab({
				// 	url: "/pages/home/index"
				// });
			}else{
				console.log('未登录')
				uni.navigateTo({
					url:"/pages/login/index"
				})
			}
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	@import url("common/globleCSS/globle.css");
	@import url("common/globleCSS/iconfont.css");
	/*每个页面公共css */
	/* 公共背景颜色 */
	page {
		background-color: var(--bg-color);
	}
</style>
